<template>
  <div class="xianshi">
    <fanhui></fanhui>
    <div class="xianshi-item">
      <van-swipe
        class="my-swipe"
        :autoplay="3000"
        indicator-color="white"
      >
        <van-swipe-item
          v-for="item in lbtlist"
          :key="item.id"
        >
          <img
            class="lbtimg"
            v-lazy="item"
            alt=""
          >
        </van-swipe-item>

      </van-swipe>
    </div>

    <!-- <van-divider
      v-for="item in datatime"
      :key="item.id"
    >

      <div>
        <p></p>
        <p><van-button round type="info">圆形按钮</van-button></p>
      </div>
    </van-divider> -->

    <div>
      <van-divider>限时秒杀</van-divider>
    </div>
    <miaosha :shangplist="shangplist"></miaosha>
  </div>
</template>
<script>
import fanhui from "../../components/fanhui/fanhui.vue";
import miaosha from "../../components/miaosha/miaosha.vue";
export default {
  data() {
    return {
      datatime: [],
      // 秒杀活动商品内容
      shangplist: [],
      // 轮播图
      lbtlist: [],
    };
  },
  methods: {
    // 轮播图
    async getlbt() {
      const res = await this.$http.getmiaoshalbt();
      console.log(res.data.data);
      this.lbtlist = res.data.data;
    },
    // 秒杀活动 今日爆款 活动时间
    async getseck() {
      const res = await this.$http.getseckills();
      // console.log(res);
      this.datatime = res.data.data;
    },
    // 秒杀活动商品内容
    async getshangp() {
      const res = await this.$http.miaoshadata();
      // console.log(res.data.data.list);
      this.shangplist = res.data.data.list;
    },
    
  },
  created() {
    this.getlbt();
    this.getseck();
    this.getshangp();
  },
  components: {
    miaosha,
    fanhui,
  },
};
</script>
<style lang="scss">
.xianshi {
  .xianshi-item {
    width: 90%;
    margin: 5% auto;
    border-radius: 10px;
    .my-swipe .van-swipe-item {
      height: 160px;
      text-align: center;
      color: #fff;
      font-size: 20px;
      line-height: 150px;
      text-align: center;
      // background-color: #39a9ed;
      width: 90%;
    }
  }
  .lbtimg {
    width: 373px;
    height: 158px;
  }
}
</style>